<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>新闻列表</title>
    <meta name="viewport" content="width=device-width,initial-scale=1.0,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.4/css/bootstrap.min.css">
</head>
<body>
    <div class="container">
        <table class="table table-bordered table-hover"  style="text-align: center">
            <tr>
               <th style="text-align: center" colspan="3" align="center">资讯列表</th>
            </tr>
            <tr>
                <th>ID</th>
                <th>标题</th>
                <th>操作</th>
            </tr>
            <?php if(is_array($NewsList)): foreach($NewsList as $key=>$NewsList): ?><tr>
                    <td><?php echo ($NewsList['id']); ?></td>
                    <td><a href="http://weixin.weirongm.com/DaChongQing/News/content/id/<?php echo ($NewsList['id']); ?>" target="_blank"><?php echo ($NewsList['title']); ?></a></td>
                    <td>
                        <button data-id="<?php echo ($NewsList['id']); ?>" type="button" class="btn btn-danger" onclick="javascript:location.href='<?php echo U("News/del",array("id"=>$NewsList['id']));?>'">DELETE</button>
                        <button data-id="<?php echo ($NewsList['id']); ?>" type="button" class="btn btn-info" onclick="javascript:location.href='<?php echo U("News/upd",array("id"=>$NewsList['id']));?>'">UPDATE</button>
                    </td>
                </tr><?php endforeach; endif; ?>
        </table>
    </div>
</body>
</html>